﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Group_Project_Book_Store
{
    /// <summary>
    /// Item of book in the system, an invoice can have one or more items
    /// A book has a publisher
    /// A book has an Author
    /// A book has a category
    /// A book has a cost
    /// </summary>
    class clsBook
    {
        /// <summary>
        /// Unique ID for the book
        /// </summary>
        public int bookID { get; set; }
        /// <summary>
        /// Book title
        /// </summary>
        public string bookTitle { get; set; }
        /// <summary>
        /// ISBN number of the book
        /// </summary>
        public string ISBN { get; set; }
        /// <summary>
        /// A Book has a publisher
        /// </summary>
        public clsPublisher Publisher { get; set; }
        /// <summary>
        /// A book has an author
        /// </summary>
        public clsAuthors Author { get; set; }
        /// <summary>
        /// A book has a category
        /// </summary>
        public clsCategory categoryType { get; set; }
        /// <summary>
        /// Cost of the book
        /// </summary>
        public int bookCost { get; set; }
        /// <summary>
        /// Date the book was entered into the invoice system
        /// </summary>
        public DateTime itemDateEnteredTS { get; set; }
        /// <summary>
        /// get and set book quantity
        /// </summary>
        public int quantity { get; set; }
        /// <summary>
        /// override method and return book Title and book cost
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            try
            {
                 return bookTitle + " | $ " + bookCost.ToString() + ".00";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }
    }
}
